package com.example.springboot.mybatis.config;

import com.github.pagehelper.PageHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * 分页处理类
 * 
 * @author Administrator
 * 
 */
@Configuration
public class MybatisConfigure {

	@Bean
	public PageHelper pageHelper() {
		PageHelper page = new PageHelper();
		Properties p = new Properties();
		p.setProperty("offsetAsPageNum", "true");
		p.setProperty("rowBoundsWithCount", "true");
		p.setProperty("reasonable", "true");
		page.setProperties(p);
		return page;
	}
}
